
<link rel='stylesheet' type='text/css'
	href='<?php
	echo base_url ()?>css/redmond/jquery-ui-1.8.1.custom.css' />
<script type='text/javascript'
	src='<?php
	echo base_url ()?>js/jquery-ui-1.8.1.custom.min.js'></script>
<script type="text/javascript">
			$(function(){
				// Tabs
				$('#tabs').tabs();
				
				$('#DOB ,#DOB_father, #DOB_mother').datepicker({
					dateFormat: 'yy-mm-dd',
					changeMonth: true,
					changeYear: true,
					yearRange: '1920'
					});
				
				
				
				$('#addnew').click(function(){
								$('#dialog').dialog('open');
								$("#dialog").load('<?php echo site_url()?>/patient/do_upload1/<?php echo $patient_info['code']?>');
					             //$('#attach').show();
					});
					
				$('#dialog').dialog({
					autoOpen: false,
					show: 'explode',
					hide: 'explode',
					modal: true
				});
			});

			$(document).ready(function(){
				$('#attach').hide();
				})	;
	</script>



<!-- Tabs -->
<h2 class=""><?php echo lang ( 'menuitem_patient' ) . ' ' . lang ( 'form_label_details' )?></h2>



<div class="ui-widget">
<div style="margin-top: 20px; padding: 0pt 0.7em;" class="ui-state-highlight ui-corner-all">
<p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-person"></span> <strong><?php	echo lang ( 'menuitem_patient' ) . ' ' . lang ( 'form_label_name' )?> : </strong>
                <?php echo $patient_info ['first_name'] . ' ' . $patient_info ['last_name'];?>
                <br>
<span style="float: left; margin-right: 0.3em;"
	class="ui-icon ui-icon-unlocked"></span> <strong><?php echo lang ( 'menuitem_patient' ) . ' ' . lang ( 'general_code' )?> :</strong> <?php echo $patient_info ['code']?></p>
</div>
</div>
<br>

<?php
echo validation_errors ();
?>

<div id="tabs">
<ul>
	<li><a href="#tabs-1"><?php	echo lang ( 'general_general' )?></a></li>
	<li><a href="#tabs-2"><?php	echo lang ( 'form_label_home_address' )?></a></li>
	<li><a href="#tabs-3"><?php	echo lang ( 'form_label_bussiness_address' )?></a></li>
	<li><a href="#tabs-4"><?php	echo lang ( 'form_label_contact' )?></a></li>
	<li><a href="#tabs-5"><?php	echo lang ( 'form_label_family' )?></a></li>
	<li><a href="#tabs-6"><?php echo lang('menuitem_medical_history')?></a></li>
	<li><a href="#tabs-7"><?php echo lang('form_label_attachment')?></a></li>
</ul>

<form id="customForm" method="post"	action="<?php echo site_url ()?>/patient/patient_details/<?php if (isset ( $patient_id )) echo $patient_id?>">
<input type="hidden" id="patient_id" name="patient_form[patient_id]" value="<?php echo set_value ( 'patient_id' );	if (isset ( $patient_id ))		echo $patient_id?>" />

<div id="tabs-1"><label><?php echo lang ( 'form_label_personal_id' )?></label>
<input type="text" id="personal_id" name="patient_form[personal_id]" value="<?php echo set_value ( 'personal_id' );	if (isset ( $personal_id ))	echo $personal_id?>" />

<label><?php echo lang ( 'form_label_birth' )?></label> 
<input type="text"	id="DOB" name="patient_form[DOB]" value="<?php	echo set_value ( 'DOB' );	if (isset ( $DOB ))		echo $DOB?>" /> <label>
<?php
	echo lang ( 'form_label_gender' )?></label>
<select id="gender" name="patient_form[gender]">
	<option value="">-- <?php echo lang ( 'menuitem_select' )?> --</option>
	<option value="M" <?php if (isset ( $gender ) && $gender == "M") echo "selected"; echo set_select ( 'patient_form[gender]', 'M' );?>>M</option>
	<option value="F" <?php	if (isset ( $gender ) && $gender == "F") echo "selected"; echo set_select ( 'patient_form[gender]', 'F' );?>>F</option>
</select> 

<label>Insurance type</label>
 <input type="text" id="insurance_id " name="patient_form[insurance_id]" value="<?php	echo set_value ( 'insurance_id' );	if (isset ( $insurance_id ))		echo $insurance_id?>" />
<label>Insurance Number</label>
 <input type="text" id="Insurance_num"	name="patient_form[Insurance_num]"	value="<?php	echo set_value ( 'Insurance_num' );	if (isset ( $Insurance_num ))		echo $Insurance_num?>" />

<label>Blood group </label> <select id="blood_type"	name="patient_form[blood_type]">
	<option value="NUL">-- <?php echo lang ( 'menuitem_select' )?> --</option>
	<option value="A +"	<?php	if (isset ( $blood_type ) && $blood_type == "A +")	echo "selected"; echo set_select ( 'patient_form[blood_type]', 'A +' );	?>>A+</option>
	<option value="A -"	<?php	if (isset ( $blood_type ) && $blood_type == "A -")	echo "selected"; echo set_select ( 'patient_form[blood_type]', 'A -' );	?>>A-</option>
	<option value="B +"	<?php	if (isset ( $blood_type ) && $blood_type == "B +")	echo "selected"; echo set_select ( 'patient_form[blood_type]', 'B +' );	?>>B+</option>
	<option value="B -"	<?php if (isset ( $blood_type ) && $blood_type == "B -")			echo "selected";		echo set_select ( 'patient_form[blood_type]', 'B -' );		?>>B	-</option>
	<option value="O +"		<?php		if (isset ( $blood_type ) && $blood_type == "O +")			echo "selected";		echo set_select ( 'patient_form[blood_type]', 'O +' );		?>>O	+</option>
	<option value="O -"		<?php		if (isset ( $blood_type ) && $blood_type == "O -")			echo "selected";		echo set_select ( 'patient_form[blood_type]', 'O -' );		?>>O	-</option>
	<option value="AB +"		<?php		if (isset ( $blood_type ) && $blood_type == "AB +")			echo "selected";		echo set_select ( 'patient_form[blood_type]', 'AB +' );		?>>AB	+</option>
	<option value="AB -"		<?php		if (isset ( $blood_type ) && $blood_type == "AB -")			echo "selected";		echo set_select ( 'patient_form[blood_type]', 'AB +' );		?>>AB	-</option>
</select> 
<label>Profession </label>
 <input type="text" id="profession"	name="patient_form[profession]"	value="<?php	echo set_value ( 'profession' );	if (isset ( $profession ))		echo $profession?>" />
</div>
<!-- END tabs-6 -->
<div id="tabs-6"></div>

<!-- END tabs-7 -->
<div id="tabs-7">
	<div id="dialog" title="Upload"><br><br><img src='<?php echo base_url ()?>images/loading.gif'></div>
<div id="attachments">
<?php $data = array(
    'name' => 'addnew',
    'id' => 'addnew',
    'value' => 'true',
    'type' => 'button',
    'class'=>'btn',
    'content' => lang ( 'menuitem_add_new' )
);

echo form_button($data);
echo "<br>";
if(!empty($attachements) && is_array($attachements) ){

	foreach($attachements as $index=>$attachment)
	 echo "<div><a href=".base_url ()."AttachedData/".$patient_info['code']."/".$attachment.">".$attachment."</a></div>";   
	
	
}?>
</div>
</div>



<!-- END tabs-1 -->
<div id="tabs-2"><label><?php
echo lang ( 'form_label_street' )?> </label>
<input type="text" id="" name="patient_form[street]"
	value="<?php
	echo set_value ( 'street' );
	if (isset ( $street ))
		echo $street?>" />
<label><?php
echo lang ( 'form_label_city' )?> </label> <input type="text"
	id="city" name="patient_form[city]"
	value="<?php
	echo set_value ( 'city' );
	if (isset ( $city ))
		echo $city?>" />
<label><?php
echo lang ( 'form_label_state' )?> </label> <input type="text"
	id="state" name="patient_form[state]"
	value="<?php
	echo set_value ( 'state' );
	if (isset ( $state ))
		echo $state?>" />
<label><?php
echo lang ( 'form_label_zip_code' )?> </label> <input
	type="text" id="zip_code" name="patient_form[zip_code]"
	value="<?php
	echo set_value ( 'zip_code' );
	if (isset ( $zip_code ))
		echo $zip_code?>" />
<label><?php
echo lang ( 'form_label_country' )?> </label> <input
	type="text" id="country" name="patient_form[country]"
	value="<?php
	echo set_value ( 'country' );
	if (isset ( $country ))
		echo $country?>" />
<label><?php
echo lang ( 'form_label_other_signals' )?> </label> <input
	type="text" id="other_signals" name="patient_form[other_signals]"
	value="<?php
	echo set_value ( 'other_signals' );
	if (isset ( $other_signals ))
		echo $other_signals?>" />
</div>
<!-- END tabs-2 -->
<div id="tabs-3"><label>Street </label> <input type="text" id=""
	name="patient_formA[]"
	value="<?php
	echo set_value ( 'personal_id' );
	if (isset ( $personal_id ))
		echo $personal_id?>" />
<label>City </label> <input type="text" id="" /> <label>State </label> <input
	type="text" id="" name="patient_formA[]"
	value="<?php
	echo set_value ( 'insurancetype' );
	if (isset ( $insurancetype ))
		echo $insurancetype?>" />
<label>Zip Code </label> <input type="text" id="" name="patient_formA[]"
	value="<?php
	echo set_value ( 'insurancetype' );
	if (isset ( $insurancetype ))
		echo $insurancetype?>" />
<label>Country </label> <input type="text" id="" name="patient_formA[]"
	value="<?php
	echo set_value ( 'insurance' );
	if (isset ( $insurance ))
		echo $insurance?>" />
<label>Other signals </label> <input type="text" id=""
	name="patient_formA[]"
	value="<?php
	echo set_value ( 'insurance' );
	if (isset ( $insurance ))
		echo $insurance?>" />
</div>
<!-- END tabs-3 -->
<div id="tabs-4"><label><?php
echo lang ( 'form_label_home_phone' )?> 1 </label>
<input type="text" id="" name="patient_form[home_phone_1]"
	value="<?php
	echo set_value ( 'home_phone_1' );
	if (isset ( $home_phone_1 ))
		echo $home_phone_1?>" />
<label><?php
echo lang ( 'form_label_home_phone' )?> 2 </label> <input
	type="text" id="" name="patient_form[home_phone_2]"
	value="<?php
	echo set_value ( 'home_phone_2' );
	if (isset ( $home_phone_2 ))
		echo $home_phone_2?>" />
<label><?php
echo lang ( 'form_label_mobile_phone' )?> 1 </label> <input
	type="text" id="" name="patient_form[mobil_phone_1]"
	value="<?php
	echo set_value ( 'mobil_phone_1' );
	if (isset ( $mobil_phone_1 ))
		echo $mobil_phone_1?>" />
<label><?php
echo lang ( 'form_label_mobile_phone' )?> 2 </label> <input
	type="text" id="" name="patient_form[mobil_phone_2]"
	value="<?php
	echo set_value ( 'mobil_phone_2' );
	if (isset ( $mobil_phone_2 ))
		echo $mobil_phone_2?>" />
<label><?php
echo lang ( 'form_label_business_phone' )?> </label> <input
	type="text" id="" name="patient_form[business_phone]"
	value="<?php
	echo set_value ( 'business_phone' );
	if (isset ( $business_phone ))
		echo $business_phone?>" />
<label><?php
echo lang ( 'form_label_other_phone' )?> </label> <input
	type="text" id="" name="patient_form[other_phone]"
	value="<?php
	echo set_value ( 'other_phone' );
	if (isset ( $other_phone ))
		echo $other_phone?>" />
</div>
<!-- END tabs-4 -->
<div id="tabs-5"><label><?php
echo lang ( 'form_label_responsable' )?>  </label>
<input type="text" id="" name="patient_form[responsable]"
	value="<?php
	echo set_value ( 'responsable' );
	if (isset ( $responsable ))
		echo $responsable?>" />
<label><?php
echo lang ( 'form_label_mother' )?>  </label> <input
	type="text" id="" name="patient_form[mother]"
	value="<?php
	echo set_value ( 'mother' );
	if (isset ( $mother ))
		echo $mother?>" />
<label><?php
echo lang ( 'form_label_mother' ) . ' ' . lang ( 'form_label_DOB' )?> </label>
<input type="text" id="DOB_mother" name="patient_form[DOB_mother]"
	value="<?php
	echo set_value ( 'DOB_mother' );
	if (isset ( $DOB_mother ))
		echo $DOB_mother?>" />
<label><?php
echo lang ( 'form_label_father' )?>   </label> <input
	type="text" id="" name="patient_form[father]"
	value="<?php
	echo set_value ( 'father' );
	if (isset ( $father ))
		echo $father?>" />
<label><?php
echo lang ( 'form_label_father' ) . ' ' . lang ( 'form_label_DOB' )?>  </label>
<input type="text" id="DOB_father" name="patient_form[DOB_father]"
	value="<?php
	echo set_value ( 'DOB_father' );
	if (isset ( $DOB_father ))
		echo $DOB_father?>" />
<label><?php
echo lang ( 'form_label_spouse' )?>  </label> <input
	type="text" id="" name="patient_form[spouse]"
	value="<?php
	echo set_value ( 'spouse' );
	if (isset ( $spouse ))
		echo $spouse?>" />
</div>
<!-- END tabs-5 -->
</div>
<input class="btn" type="submit" id="submit" name="submit" value="<?php echo lang ( 'form_label_save' )?>" />
</form>
</div>


